import time
import unittest
from parameterized import parameterized
from excel_driver import excel_read
from utils import DriverUtils
from web_keys.Action_Keys import CaseActionKeys





class TestLogin(unittest.TestCase):
    @classmethod
    def setUpClass(cls):
        cls.driver = CaseActionKeys()
        cls.driver.open("http://192.168.179.128/index.php/Home/user/login.html")


    @classmethod
    def tearDownClass(cls):
        time.sleep(2)
        DriverUtils.close_driver()

    def setUp(self):
        pass


    def tearDown(self):
        pass

    @parameterized.expand(excel_read.excelUtils('\data\测试用例.xlsx'))
    def test1_login(self,action,data,describe):
        print("测试参数：{}".format(data))
        print("操作行为：{}".format(action))
        print("正在执行：{}".format(describe))
        getattr(self.driver, action)(**data)
        time.sleep(1)




